<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

</body>

</html>

<script>
  /* 案例：1-100 相加

    var total = 0;
    for (var num = 0; num <= 100; num++) {
      total += num;
    }
  
    console.log(total);
  
  */


  /* 案例： 1-10 相乘
  
    var total = 1;
    for (var num = 1; num <= 10; num++) {
      total *= num;
    }
  
    console.log(total);
  
  */


  /* 打印出 1-24 层楼；  除去 14 和 4
  
  
  */

  for (var floor = 1; floor <= 24; floor++) {
    // 假设 floor 为 4
    if (floor !== 4 || floor !== 14) {
      console.log(`当前楼层是${floor}`); // 打印结果： 1-24 都被打印
    }
  }



</script>